
class CInPlaceControl 
{
protected:
	int m_iItem;
	int m_iSubItem;
	BOOL m_bESC;         // To indicate whether ESC key was pressed
public:
	CInPlaceControl(int iItem, int iSubItem);
	virtual void CalculateSize() = NULL;
	virtual CWnd* GetWnd() = NULL;
	virtual ~CInPlaceControl();
};
// InPlaceEdit.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CInPlaceEdit window

class CInPlaceEdit : public CEdit, public CInPlaceControl
{
// Construction
public:

// Attributes
public:

// Operations
public:

// Overrides
        // ClassWizard generated virtual function overrides
        //{{AFX_VIRTUAL(CInPlaceEdit)
        public:
        virtual BOOL PreTranslateMessage(MSG* pMsg);
        //}}AFX_VIRTUAL

// Implementation
public:
		CInPlaceEdit(CWnd* parentWnd, int iItem, int iSubItem, CString sInitText);

        // Generated message map functions
protected:
        //{{AFX_MSG(CInPlaceEdit)
        afx_msg void OnKillFocus(CWnd* pNewWnd);
        afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
        afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
private:
	virtual ~CInPlaceEdit();
	virtual void CalculateSize();
	virtual CWnd* GetWnd();
	CString m_sInitText;
};

class CInPlaceComboBox : public CComboBox, public CInPlaceControl
{
// Construction
public:
	CInPlaceComboBox(CWnd* parentWnd, int iItem, int iSubItem, const map<long, string>& combData, long initValue);

// Attributes
public:

// Operations
public:

// Overrides
        // ClassWizard generated virtual function overrides
        //{{AFX_VIRTUAL(CInPlaceComboBox)
        public:
        virtual BOOL PreTranslateMessage(MSG* pMsg);
        //}}AFX_VIRTUAL

// Implementation
public:
        // Generated message map functions
protected:
        //{{AFX_MSG(CInPlaceComboBox)
        afx_msg void OnKillFocus(CWnd* pNewWnd);
        afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
        afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
private:
	virtual ~CInPlaceComboBox();
	virtual void CalculateSize();
	virtual CWnd* GetWnd();
	CString m_sInitText;
	CString m_strMax;
};

class CInPlaceListCtrl : public CListCtrl, public CInPlaceControl
{
	// Construction
public:
	CInPlaceListCtrl(CWnd* parentWnd, int iItem, int iSubItem, const map<long, string>& listData, const set<long>& checked);
	
	// Attributes
public:
	
	// Operations
public:
	
	// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CInPlaceComboBox)
public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	//}}AFX_VIRTUAL
	
	// Implementation
public:
	
	// Generated message map functions
protected:
	//{{AFX_MSG(CInPlaceComboBox)
	afx_msg void OnKillFocus(CWnd* pNewWnd);
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	virtual ~CInPlaceListCtrl();
	virtual CWnd* GetWnd();
	void CalculateSize();
//	CString m_strMax;
};

/////////////////////////////////////////////////////////////////////////////